package com.jltx.xq.simplewatch.utils;

import android.database.Cursor;
import android.os.Build;

import java.io.Closeable;
import java.io.IOException;

/**
 * @author jltxseo
 *         Created by junlintianxia on 2017/08/26.
 */

public class IOUtils {

    public  static  void closeIO(Cursor cursor) {
        if(Build.VERSION.SDK_INT <= 15){
            if(cursor != null){
                cursor.close();
            }
        }else {
            closeIO((Closeable)cursor);
        }

    }

    public static void closeIO(Closeable closeable){
        if(closeable != null){
            try {
                closeable.close();
            } catch (IOException e) {

            }
        }
    }
}
